<template>
  <div class="home">
    <Home-header></Home-header>
    <home-swiper :list="swiperList"></home-swiper>
    <home-icons :iconsList="iconList"></home-icons>
    <home-recommend :recommendList="recommendList"></home-recommend>
    <home-weekend :weekendList="weekendList"></home-weekend>
  </div>
</template>
<script>
import HomeHeader from './components/Header'
import HomeSwiper from './components/Swiper'
import HomeIcons from './components/icons'
import HomeRecommend from './components/Recommend'
import HomeWeekend from './components/Weekend'
export default {
  components: {
    HomeHeader,
    HomeSwiper,
    HomeIcons,
    HomeRecommend,
    HomeWeekend
  },
  data () {
    return {
      city: '',
      swiperList: [],
      iconList: [],
      recommendList: [],
      weekendList: []
    }
  },
  mounted () {
    this.getHomeInfo()
  },
  methods: {
    async getHomeInfo () {
      const {data} = await this.$http.get('api/index.json')
      if (!data.ret) return console.log('服务器出错')
      // this.city=""
      // 轮播图区域赋值
      this.swiperList = data.data.swiperList
      this.iconList = data.data.iconList
      this.recommendList = data.data.recommendList
      this.weekendList = data.data.weekendList
      console.log(data)
      // console.log(this.iconList)
    }
  }

}
</script>
<style  scoped>

</style>
